3.1096 \(\int x^2 (A+B x) (a+b x+c x^2)^p \, dx\)

Optimal. Leaf size=287 \[ -\frac {2^{p-1} \left (a+b x+c x^2\right )^{p+1} \left (-\frac {-\sqrt {b^2-4 a c}+b+2 c x}{\sqrt {b^2-4 a c}}\right )^{-p-1} \left (-4 a A c^2+6 a b B c+2 A b^2 c (p+2)+b^3 (-B) (p+3)\right ) \, _2F_1\left (-p,p+1;p+2;\frac {b+2 c x+\sqrt {b^2-4 a c}}{2 \sqrt {b^2-4 a c}}\right )}{c^3 (p+1) (2 p+3) \sqrt {b^2-4 a c}}-\frac {\left (a+b x+c x^2\right )^{p+1} (2 a B c (2 p+3)-2 c (p+1) x (2 A c (p+2)-b B (p+3))+b (p+2) (2 A c (p+2)-b B (p+3)))}{4 c^3 (p+1) (p+2) (2 p+3)}+\frac {B x^2 \left (a+b x+c x^2\right )^{p+1}}{2 c (p+2)} \]

[Out]

1/2*B*x^2*(c*x^2+b*x+a)^(1+p)/c/(2+p)-1/4*(2*a*B*c*(3+2*p)+b*(2+p)*(2*A*c*(2+p)-b*B*(3+p))-2*c*(1+p)*(2*A*c*(2
+p)-b*B*(3+p))*x)*(c*x^2+b*x+a)^(1+p)/c^3/(2+p)/(2*p^2+5*p+3)-2^(-1+p)*(6*a*b*B*c-4*a*A*c^2+2*A*b^2*c*(2+p)-b^
3*B*(3+p))*(c*x^2+b*x+a)^(1+p)*hypergeom([-p, 1+p],[2+p],1/2*(b+2*c*x+(-4*a*c+b^2)^(1/2))/(-4*a*c+b^2)^(1/2))*
((-b-2*c*x+(-4*a*c+b^2)^(1/2))/(-4*a*c+b^2)^(1/2))^(-1-p)/c^3/(1+p)/(3+2*p)/(-4*a*c+b^2)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.29, antiderivative size = 287, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {832, 779, 624} \[ -\frac {2^{p-1} \left (a+b x+c x^2\right )^{p+1} \left (-\frac {-\sqrt {b^2-4 a c}+b+2 c x}{\sqrt {b^2-4 a c}}\right )^{-p-1} \left (-4 a A c^2+6 a b B c+2 A b^2 c (p+2)+b^3 (-B) (p+3)\right ) \, _2F_1\left (-p,p+1;p+2;\frac {b+2 c x+\sqrt {b^2-4 a c}}{2 \sqrt {b^2-4 a c}}\right )}{c^3 (p+1) (2 p+3) \sqrt {b^2-4 a c}}-\frac {\left (a+b x+c x^2\right )^{p+1} (2 a B c (2 p+3)-2 c (p+1) x (2 A c (p+2)-b B (p+3))+b (p+2) (2 A c (p+2)-b B (p+3)))}{4 c^3 (p+1) (p+2) (2 p+3)}+\frac {B x^2 \left (a+b x+c x^2\right )^{p+1}}{2 c (p+2)} \]

Antiderivative was successfully verified.

[In]

Int[x^2*(A + B*x)*(a + b*x + c*x^2)^p,x]

[Out]

(B*x^2*(a + b*x + c*x^2)^(1 + p))/(2*c*(2 + p)) - ((2*a*B*c*(3 + 2*p) + b*(2 + p)*(2*A*c*(2 + p) - b*B*(3 + p)
) - 2*c*(1 + p)*(2*A*c*(2 + p) - b*B*(3 + p))*x)*(a + b*x + c*x^2)^(1 + p))/(4*c^3*(1 + p)*(2 + p)*(3 + 2*p))
- (2^(-1 + p)*(6*a*b*B*c - 4*a*A*c^2 + 2*A*b^2*c*(2 + p) - b^3*B*(3 + p))*(-((b - Sqrt[b^2 - 4*a*c] + 2*c*x)/S
qrt[b^2 - 4*a*c]))^(-1 - p)*(a + b*x + c*x^2)^(1 + p)*Hypergeometric2F1[-p, 1 + p, 2 + p, (b + Sqrt[b^2 - 4*a*
c] + 2*c*x)/(2*Sqrt[b^2 - 4*a*c])])/(c^3*Sqrt[b^2 - 4*a*c]*(1 + p)*(3 + 2*p))

Rule 624

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, -Simp[((a + b*x + c*
x^2)^(p + 1)*Hypergeometric2F1[-p, p + 1, p + 2, (b + q + 2*c*x)/(2*q)])/(q*(p + 1)*((q - b - 2*c*x)/(2*q))^(p
 + 1)), x]] /; FreeQ[{a, b, c, p}, x] && NeQ[b^2 - 4*a*c, 0] &&  !IntegerQ[4*p]

Rule 779

Int[((d_.) + (e_.)*(x_))*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> -Simp[((b
*e*g*(p + 2) - c*(e*f + d*g)*(2*p + 3) - 2*c*e*g*(p + 1)*x)*(a + b*x + c*x^2)^(p + 1))/(2*c^2*(p + 1)*(2*p + 3
)), x] + Dist[(b^2*e*g*(p + 2) - 2*a*c*e*g + c*(2*c*d*f - b*(e*f + d*g))*(2*p + 3))/(2*c^2*(2*p + 3)), Int[(a
+ b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, p}, x] && NeQ[b^2 - 4*a*c, 0] &&  !LeQ[p, -1]

Rule 832

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Sim
p[(g*(d + e*x)^m*(a + b*x + c*x^2)^(p + 1))/(c*(m + 2*p + 2)), x] + Dist[1/(c*(m + 2*p + 2)), Int[(d + e*x)^(m
 - 1)*(a + b*x + c*x^2)^p*Simp[m*(c*d*f - a*e*g) + d*(2*c*f - b*g)*(p + 1) + (m*(c*e*f + c*d*g - b*e*g) + e*(p
 + 1)*(2*c*f - b*g))*x, x], x], x] /; FreeQ[{a, b, c, d, e, f, g, p}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 -
 b*d*e + a*e^2, 0] && GtQ[m, 0] && NeQ[m + 2*p + 2, 0] && (IntegerQ[m] || IntegerQ[p] || IntegersQ[2*m, 2*p])
&&  !(IGtQ[m, 0] && EqQ[f, 0])

Rubi steps

\begin {align*} \int x^2 (A+B x) \left (a+b x+c x^2\right )^p \, dx &=\frac {B x^2 \left (a+b x+c x^2\right )^{1+p}}{2 c (2+p)}+\frac {\int x (-2 a B+(2 A c (2+p)-b B (3+p)) x) \left (a+b x+c x^2\right )^p \, dx}{2 c (2+p)}\\ &=\frac {B x^2 \left (a+b x+c x^2\right )^{1+p}}{2 c (2+p)}-\frac {(2 a B c (3+2 p)+b (2+p) (2 A c (2+p)-b B (3+p))-2 c (1+p) (2 A c (2+p)-b B (3+p)) x) \left (a+b x+c x^2\right )^{1+p}}{4 c^3 (1+p) (2+p) (3+2 p)}+\frac {\left (6 a b B c-4 a A c^2+2 A b^2 c (2+p)-b^3 B (3+p)\right ) \int \left (a+b x+c x^2\right )^p \, dx}{4 c^3 (3+2 p)}\\ &=\frac {B x^2 \left (a+b x+c x^2\right )^{1+p}}{2 c (2+p)}-\frac {(2 a B c (3+2 p)+b (2+p) (2 A c (2+p)-b B (3+p))-2 c (1+p) (2 A c (2+p)-b B (3+p)) x) \left (a+b x+c x^2\right )^{1+p}}{4 c^3 (1+p) (2+p) (3+2 p)}-\frac {2^{-1+p} \left (6 a b B c-4 a A c^2+2 A b^2 c (2+p)-b^3 B (3+p)\right ) \left (-\frac {b-\sqrt {b^2-4 a c}+2 c x}{\sqrt {b^2-4 a c}}\right )^{-1-p} \left (a+b x+c x^2\right )^{1+p} \, _2F_1\left (-p,1+p;2+p;\frac {b+\sqrt {b^2-4 a c}+2 c x}{2 \sqrt {b^2-4 a c}}\right )}{c^3 \sqrt {b^2-4 a c} (1+p) (3+2 p)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.31, size = 210, normalized size = 0.73 \[ \frac {1}{12} x^3 \left (\frac {-\sqrt {b^2-4 a c}+b+2 c x}{b-\sqrt {b^2-4 a c}}\right )^{-p} \left (\frac {\sqrt {b^2-4 a c}+b+2 c x}{\sqrt {b^2-4 a c}+b}\right )^{-p} (a+x (b+c x))^p \left (4 A F_1\left (3;-p,-p;4;-\frac {2 c x}{b+\sqrt {b^2-4 a c}},\frac {2 c x}{\sqrt {b^2-4 a c}-b}\right )+3 B x F_1\left (4;-p,-p;5;-\frac {2 c x}{b+\sqrt {b^2-4 a c}},\frac {2 c x}{\sqrt {b^2-4 a c}-b}\right )\right ) \]

Warning: Unable to verify antiderivative.

[In]

Integrate[x^2*(A + B*x)*(a + b*x + c*x^2)^p,x]

[Out]

(x^3*(a + x*(b + c*x))^p*(4*A*AppellF1[3, -p, -p, 4, (-2*c*x)/(b + Sqrt[b^2 - 4*a*c]), (2*c*x)/(-b + Sqrt[b^2
- 4*a*c])] + 3*B*x*AppellF1[4, -p, -p, 5, (-2*c*x)/(b + Sqrt[b^2 - 4*a*c]), (2*c*x)/(-b + Sqrt[b^2 - 4*a*c])])
)/(12*((b - Sqrt[b^2 - 4*a*c] + 2*c*x)/(b - Sqrt[b^2 - 4*a*c]))^p*((b + Sqrt[b^2 - 4*a*c] + 2*c*x)/(b + Sqrt[b
^2 - 4*a*c]))^p)

________________________________________________________________________________________

fricas [F]  time = 0.84, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (B x^{3} + A x^{2}\right )} {\left (c x^{2} + b x + a\right )}^{p}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(B*x+A)*(c*x^2+b*x+a)^p,x, algorithm="fricas")

[Out]

integral((B*x^3 + A*x^2)*(c*x^2 + b*x + a)^p, x)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B x + A\right )} {\left (c x^{2} + b x + a\right )}^{p} x^{2}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(B*x+A)*(c*x^2+b*x+a)^p,x, algorithm="giac")

[Out]

integrate((B*x + A)*(c*x^2 + b*x + a)^p*x^2, x)

________________________________________________________________________________________

maple [F]  time = 1.55, size = 0, normalized size = 0.00 \[ \int \left (B x +A \right ) x^{2} \left (c \,x^{2}+b x +a \right )^{p}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(B*x+A)*(c*x^2+b*x+a)^p,x)

[Out]

int(x^2*(B*x+A)*(c*x^2+b*x+a)^p,x)

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B x + A\right )} {\left (c x^{2} + b x + a\right )}^{p} x^{2}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(B*x+A)*(c*x^2+b*x+a)^p,x, algorithm="maxima")

[Out]

integrate((B*x + A)*(c*x^2 + b*x + a)^p*x^2, x)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.00 \[ \int x^2\,\left (A+B\,x\right )\,{\left (c\,x^2+b\,x+a\right )}^p \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(A + B*x)*(a + b*x + c*x^2)^p,x)

[Out]

int(x^2*(A + B*x)*(a + b*x + c*x^2)^p, x)

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*(B*x+A)*(c*x**2+b*x+a)**p,x)

[Out]

Timed out

________________________________________________________________________________________